#include <iostream>
#include <numeric>
#include <iterator>
#include <functional>
#include <vector>
#include <algorithm>
#include "algorithm_1.h"
#include "numeric_1.h"

using namespace std;

int main(){

	vector<int> ivec(10,4);
	cout<<accumulate_1(ivec.begin(),ivec.end(),int());
	cout<<accumulate_1(ivec.begin(),ivec.end(),int(),minus<int>());
	cout<<inner_product_1(ivec.begin(),ivec.end(),ivec.begin(),0,minus<int>(),plus<int>());
	cout<<inner_product(ivec.begin(),ivec.end(),ivec.begin(),0,minus<int>(),plus<int>());
	ostream_iterator<int> oite(cout," ");
	partial_sum_1(ivec.begin(),ivec.end(),oite,plus<int>());
	cout<<endl;
	adjacent_difference_1(ivec.begin(),ivec.end(),oite,multiplies<int>());
	return 0;
//	int ia[5] = {1,2,3,4,5};
//	cout<<accumulate(ia,ia+5,0)<<endl;
//	cout<<accumulate(ia,ia+5,0,minus<int>())<<endl;
//	cout<<inner_product(ia,ia+5,ia,0)<<endl;
//	cout<<inner_product(ia,ia+5,ia,0,minus<int>(),plus<int>())<<endl;
//	ostream_iterator<int> oite(cout," ");
//	partial_sum(ia,ia+5,oite);
//	partial_sum(ia,ia+5,oite,multiplies<int>());
//	adjacent_difference(ia,ia+5,oite,multiplies<int>());
//
//	cout<<endl;
//	const int array_size = 7;
//	int ia[array_size] = {0,1,2,3,4,5,6};
//	int *end = ia + array_size;
//	int *ip = find_1(ia,end,4);
//	if (ip == end)
//		cout<<"4 not found"<<endl;
//	else cout<<"4 found"<<endl;
//	vector<int> ivec(5,3);
//	vector<int> ivec_(5,4);
//	vector<int>::iterator iter1 = ivec.begin() + 2;
//	vector<int>::iterator iter2 = ivec_.begin() + 3;
//	iter_swap_1(iter1,iter2);
//	copy(ivec.begin(),ivec.end(),ostream_iterator<int>(cout,"\t"));
//	cout<<endl;
//	copy(ivec_.begin(),ivec_.end(),ostream_iterator<int>(cout,"\t"));
//	cout<<endl;
//	remove_copy_if(ivec_.begin(),ivec_.end(),ostream_iterator<int>(cout,"\t"),not1(even_1<int>()));
//	cout<<endl;
	

}
